package orm;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class DbConn {
    static{
        try {
            Class.forName(Dbconf.getConf("driver"));
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }

    public static Connection createConnection(){
        try {
            return DriverManager.getConnection(
              Dbconf.getConf("url")     ,
              Dbconf.getConf("userName")  ,
              Dbconf.getConf("password")
            );
        } catch (SQLException e) {
            e.printStackTrace();
        }
        return null;
    }
}
